UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'IFDz4iSaLkhVutsnO3EtJMx5Q3WLQxbo8HTkOKpyMv0=' 
WHERE 
  key_id = '22331230f70c9e8369fa9b66c780eb9e8d91b3123168cd1fda0876d37afbcdc3' 
  AND (
    token = 'IFDz4iSaLkhVutsnO3EtJMx5Q3WLQxbo8HTkOKpyMv0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00021