UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'w2JYo4ygwc/SwqUSIXlKFY+wgR9Z3VbrCoJuN6+e5vk='
WHERE
key_id = 'f2a4fe7f640bb769ffd18846d8af63ee9ab63c2e6fa9f644d97b6c97781cb2e7'
AND (
token = 'w2JYo4ygwc/SwqUSIXlKFY+wgR9Z3VbrCoJuN6+e5vk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)