UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'd36pBj+xh0xK91U2QlR19WsrJaYKACISHIwrjDMeqIg='
WHERE
key_id = '07612c108c41fe6a9f5079b8228e8baac73bcd2a7c7cfecf9bbeabba735e628a'
AND (
token = 'd36pBj+xh0xK91U2QlR19WsrJaYKACISHIwrjDMeqIg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)