UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'LaTr1g5qXilchNRR1Hky57gehcxFm3lO2X+jk1/Og28='
WHERE
key_id = 'c4e8d5d6842cfa4ffe2a9ea74f54b02d5ffed61dd5d6cbdf34f22fe2917726b5'
AND (
token = 'LaTr1g5qXilchNRR1Hky57gehcxFm3lO2X+jk1/Og28='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)