UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Gaa/Gy0+wSbXmxsX22vCQATdjMbEz+6Ft212wcOVZ5I=' 
WHERE 
  key_id = '26af73a7faea8f16355e8b11a20697d5f47c27bd4e9c802161badbb3ea09e09d' 
  AND (
    token = 'Gaa/Gy0+wSbXmxsX22vCQATdjMbEz+6Ft212wcOVZ5I=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033