UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'DerpG5On5JxbjdEBXph4rhqIr/TmCzecGeFkjPgbFrY='
WHERE
key_id = 'dd00cbc973f7fefe33585bde1845b37fc01232e3789b3867f2a84d36edba9c97'
AND (
token = 'DerpG5On5JxbjdEBXph4rhqIr/TmCzecGeFkjPgbFrY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)