UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '8QJ7i57LWHcgoZt0STXDBiAdJAo81HgnkkH6/qtcZ94='
WHERE
key_id = 'a6b8d71b906a0ded805ec65b8d53d7c0730d0f739680221018c8f05ec5083117'
AND (
token = '8QJ7i57LWHcgoZt0STXDBiAdJAo81HgnkkH6/qtcZ94='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)