UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'kL/yzvDQBbV5MLwoclhq14/Eo62bnlw092uta7tYCsw='
WHERE
key_id = '47a5f1bf22dd8a0637b19eff25bf2abf86d39ad511c255c7287b85448eca8f3c'
AND (
token = 'kL/yzvDQBbV5MLwoclhq14/Eo62bnlw092uta7tYCsw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)