UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'RfCxoFNyU+nbhz600E0cNSfsSOxNgkddlMG9r8rUehg='
WHERE
key_id = '45907e63e388504f0d925f5cbaaeca580ad197f3a6007d2ad93ef344b71ef39b'
AND (
token = 'RfCxoFNyU+nbhz600E0cNSfsSOxNgkddlMG9r8rUehg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)