UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'shkPP76+MdibwzHrJWtkr6Y0i9m07BKxtaLUFgVYM2M='
WHERE
key_id = 'bc18feac0e9d86ffe5a0017bf8c229ba587c574f6c6db7cb1c3780c53b948d8c'
AND (
token = 'shkPP76+MdibwzHrJWtkr6Y0i9m07BKxtaLUFgVYM2M='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)