UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'w93rqba7zFEzruobDMz2SWMWKgKBAVlrLrD1MIA1fhE=' 
WHERE 
  key_id = '92d7701de5d879e887dece726730083488addf0a5145a3c67b709fcc7f2c0d01' 
  AND (
    token = 'w93rqba7zFEzruobDMz2SWMWKgKBAVlrLrD1MIA1fhE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00040