UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'goHGl5233G+MNrYhlzbyuYyOXYFWC5aaCEmJiosAflQ='
WHERE
key_id = '8a629fefb0fa2a3b33d0917de2c0fa0d01bd72e80d06cda39f02c4a0fd9e26e7'
AND (
token = 'goHGl5233G+MNrYhlzbyuYyOXYFWC5aaCEmJiosAflQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)