UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'r/PEnqJ8XnzIvI0CC9fLsbIpl321VQAQ9HHOpj2DP/I='
WHERE
key_id = '971b67138dedd2162f2a9624db886482636dd36bff7065471998ec0802e07941'
AND (
token = 'r/PEnqJ8XnzIvI0CC9fLsbIpl321VQAQ9HHOpj2DP/I='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)