UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'mFikNWWFIbsFqZZ1pGxHOCOEK5exqvgG7e5qS+Cr5ws=' 
WHERE 
  key_id = '81115353291ec0ef4a327c7f83bedd72ed36d0981d0aeec6d3aaf78936b80150' 
  AND (
    token = 'mFikNWWFIbsFqZZ1pGxHOCOEK5exqvgG7e5qS+Cr5ws=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038