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