UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '/tCBlOIt02zJ12wGY87x8549QYbkco8IX+ZOQ4zu21Q=' 
WHERE 
  key_id = '1ce570973c85e1d8af7d22656a302aa2c4191bfd9201f5b13784abe922648bb1' 
  AND (
    token = '/tCBlOIt02zJ12wGY87x8549QYbkco8IX+ZOQ4zu21Q=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025