UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'hwdN70FmuZk75waSwUTs1B1v8aLYbCfx6Y5/AjRsdHA='
WHERE
key_id = '1203c15b787540d39fac30ba5370c7dcd68584edcb1ea7375505aad772864d71'
AND (
token = 'hwdN70FmuZk75waSwUTs1B1v8aLYbCfx6Y5/AjRsdHA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)