UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'IkDqt69fdGCNiTy5CYqEY9d5zEwdC4CMeK/7XZxKcPs='
WHERE
key_id = '1eb89407d633cf64f86ed51a7faa2028fb5c53d9b0b1931c940203118162d9cb'
AND (
token = 'IkDqt69fdGCNiTy5CYqEY9d5zEwdC4CMeK/7XZxKcPs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)