UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'VCRaDYtG3qwtjaQpErAqB4A/ze0Vh66HH02AAwGnZZI='
WHERE
key_id = 'e6dc8f2edc68fdc6c8e67bd7300db3c14ee3bd2aeda847a37a9b01454496bfcf'
AND (
token = 'VCRaDYtG3qwtjaQpErAqB4A/ze0Vh66HH02AAwGnZZI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)