UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'dGWpjMh7X3vhyOsAPcxh3Li+6lIOqU4pcgayyzpLpyQ='
WHERE
key_id = '3695a02f01555899ee3c9d95dd333b10dfafbca646790ba9f2e80aff2126c6be'
AND (
token = 'dGWpjMh7X3vhyOsAPcxh3Li+6lIOqU4pcgayyzpLpyQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)