UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'OX/oPZPb0NNEC+HiYHO1OGwluyGVt14GLt6wwaziJwM='
WHERE
key_id = 'b835197f08a2fa43ccc0cb57cf3dd0a175f5cf653c3939335efb44224136a75d'
AND (
token = 'OX/oPZPb0NNEC+HiYHO1OGwluyGVt14GLt6wwaziJwM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)