UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'oKlzhXavLas8UU/jnc3iE1EafcPu7OomfeEP9sjIiT4=' 
WHERE 
  key_id = '702fc421f5483c977cb81906eceef0d6b199f8188d105788904b44e016f557ab' 
  AND (
    token = 'oKlzhXavLas8UU/jnc3iE1EafcPu7OomfeEP9sjIiT4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034