UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'zHyW2Sgvzvle1RRI+KdzF4NtVHkzkdHHoKStZJoy7Qc=' 
WHERE 
  key_id = '9fe1a0af89f3a8f4b4f3a824412e2388adf8fe208d22a3fbb2a4276b9314b1ad' 
  AND (
    token = 'zHyW2Sgvzvle1RRI+KdzF4NtVHkzkdHHoKStZJoy7Qc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033