UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'xC1Ze3s8/K6CDz3de3ZuTOoyg5g7w1j/s/JfWM0d5/A=' 
WHERE 
  key_id = 'badc494e85ba48a22b663f82ac4b2ac33a81e9f078d154b76f0adf036d244444' 
  AND (
    token = 'xC1Ze3s8/K6CDz3de3ZuTOoyg5g7w1j/s/JfWM0d5/A=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00020