UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'SDMGPLdPb/BngKUr8QRIZWUYAWLIbOxKCQKz4rpPeM8='
WHERE
key_id = '320b107d89f0bd30f029a59f4e2d0f4ae2aa4d2fa8aed16f67977dc2c6b5115e'
AND (
token = 'SDMGPLdPb/BngKUr8QRIZWUYAWLIbOxKCQKz4rpPeM8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)