UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'C91cqnuFu3ABpro6XoJ0q2ukYIBaw2MywX3il0RLQZ8=' 
WHERE 
  key_id = 'ce8f6b79d13f9d4a4ccbbbd0cba1293c1c7a44ed2720076ea32da548866f68af' 
  AND (
    token = 'C91cqnuFu3ABpro6XoJ0q2ukYIBaw2MywX3il0RLQZ8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00014