UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '8CIEHgJLRQmeuz5GkHY7SBF7y4P22Jo898sSjUUBlAU=' 
WHERE 
  key_id = 'deb81a9c45612e13e146a0de3f37f19b3c2052dd6025d906ac17a83993a6ef1b' 
  AND (
    token = '8CIEHgJLRQmeuz5GkHY7SBF7y4P22Jo898sSjUUBlAU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00016