UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'RmBbPWjc9z4zR5wM/p8lCN1EA0IIJ3rbXuv/dwYgsHU='
WHERE
key_id = '1f4b26f787b8ef1fa3bf283a9e5c92dd22eed20867766fbc94a13f7a696e7dd0'
AND (
token = 'RmBbPWjc9z4zR5wM/p8lCN1EA0IIJ3rbXuv/dwYgsHU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)