UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'gVzZX0BMJ/i15mtBRQJfqVEMrgZRrGDA1ZJ7+er98Ro=' 
WHERE 
  key_id = '47966d7266dc92122cef14f069991867595248b0ad8a7f80fe80cf51b3203028' 
  AND (
    token = 'gVzZX0BMJ/i15mtBRQJfqVEMrgZRrGDA1ZJ7+er98Ro=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033