UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'he9Xreq5E7zA68wEmytJyZ9f1vXrtmbH7otGdSrLT9I=' 
WHERE 
  key_id = 'eacbf69d913b35443308c58733f9c3949b1d9c7b3831d832850e6154052cccbb' 
  AND (
    token = 'he9Xreq5E7zA68wEmytJyZ9f1vXrtmbH7otGdSrLT9I=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027