UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'G47F1pe3O7rl9fqBsMsWgb+PeB4vRwO2OB6qesJ2oOs='
WHERE
key_id = 'b01d2cb50f6ca03ffcdd8fa6cd11746b09de9968a18fddb4f3e5f93bc425e414'
AND (
token = 'G47F1pe3O7rl9fqBsMsWgb+PeB4vRwO2OB6qesJ2oOs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)