UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Y8TL06o6b+/Q+O7IMl7++90uNxEYCE52CSHYJMxzGrs=' 
WHERE 
  key_id = '0a8c0a2dad81b12a86d5d6ff9a968f9fbca9d22b7e2ede0a159e23278323f3c0' 
  AND (
    token = 'Y8TL06o6b+/Q+O7IMl7++90uNxEYCE52CSHYJMxzGrs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00016