UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'vPDYcC1smczV0XrQRKZyEuU1Nmz8W4b+RYDxShWfE9k='
WHERE
key_id = '570f4191affbddfb487a3f3ed76e602a1fecc2562c045be0e5d8ffbce728242b'
AND (
token = 'vPDYcC1smczV0XrQRKZyEuU1Nmz8W4b+RYDxShWfE9k='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)