UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'yFpyQQ2okNmOJUloWktjOoJTnpCBtvCV7EJGjyH2VU8=' 
WHERE 
  key_id = '088214b308189845159091770efd08008e010292c1f9391942562a9f366ffd67' 
  AND (
    token = 'yFpyQQ2okNmOJUloWktjOoJTnpCBtvCV7EJGjyH2VU8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027