UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'hgxKGTfi26+aBzflgXUFEp7KGYVpUeYIwQDU3E7Ded0=' 
WHERE 
  key_id = 'f024a4685a645b8415ae7c341db8c635f347455db7472714ffb6025a1f17feaf' 
  AND (
    token = 'hgxKGTfi26+aBzflgXUFEp7KGYVpUeYIwQDU3E7Ded0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00017