UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'PYyFPl1ZahlOPD3XjGsYDr1+qJuWW8OYxsC2NIfgjuc='
WHERE
key_id = '310719ae1014006a4b1b4ef8ba27f25424872d191e5510c656716818d2d1df97'
AND (
token = 'PYyFPl1ZahlOPD3XjGsYDr1+qJuWW8OYxsC2NIfgjuc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)