UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'AQVq7hf7VpjjV9Ex7wdL+t4SIAvfE7zzfQMWAeQxm1M='
WHERE
key_id = '70d165237bf67ee1faf7a1b522907329b8f22795f3317f41276ebb3206cf36ce'
AND (
token = 'AQVq7hf7VpjjV9Ex7wdL+t4SIAvfE7zzfQMWAeQxm1M='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)